

/*
 * Client library functions
 *
 */

/*
 * connect_to: Function to transfer raw data. Not specific to any protocol
 * This is more like an echo client.
 *
 * char* ip_addr: The ip address of the server.
 * int port: The port numner to use.
 * int ip_version: 
 *    4 - IPv4
 *    6 - IPv6
 *
 * Return:
 *    socket desc - Success
 *    -1 - Remote server not listening on port
 *    -2 - Remote server not accepting connections on port.
 *    -3 - Could not create client socket.
 *    -4 - Other errors.
 */
int connect_to_addr(char* ip_addr, int port, int ip_version);

/*
 * connect_to: Function to transfer raw data. Not specific to any protocol
 * This is more like an echo client.
 *
 * char* host_name: The hostname of the server.
 * int port: The port numner to use.
 * int ip_version: 
 *    4 - IPv4
 *    6 - IPv6
 *
 * Return:
 *    socket desc - Success
 *    -1 - Remote server not listening on port
 *    -2 - Remote server not accepting connections on port.
 *    -3 - Could not create client socket.
 *    -4 - Other errors.
 */
int connect_to_host(char* host_name, int port, int ip_version);

/*
 * smtp_data:
 *
 * char* mail_from: The SMTP protocol specified mail from header.
 * char* rcpt_to: The list of RCPT TO headers.
 * char* headers: A colon seperated list of headers to be sent in the SMTP mail.
 * For eg to send From, To, Date, include "F:T:D"
 *
 */
int smtp_set_headers(char* mail_from, char* rcpt_to[], char* headers);
